package com.selectest;

import com.tools.WaitUtil;
import com.zzkj.Main;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;


public class l_Test {

    WebDriver driver;
   // WebDriverWait wait = new WebDriverWait(driver,10);
    @Test
    public void test_01() {
        // 设置ChromeDriver的路径
        System.setProperty("webdriver.chrome.driver", "D:\\web_chromedriver\\122.6\\chromedriver.exe");

        // 创建一个Chrome浏览器实例
         driver = new ChromeDriver();
         //wait = new WebDriverWait(driver,10);

        driver.get("http://192.168.0.113:8080");

        //http://192.168.0.113:8080/


        //强制等待
        WaitUtil.forcedWaiting(3);
        System.out.println("强制等待3s");

        WebElement element = driver.findElement(By.xpath("/html/body/uni-app/uni-modal/div[2]/div[3]/div[2]"));
        element.click();


//        Actions action = new Actions(driver);
//        action.sendKeys(Keys.F12);

        WaitUtil.forcedWaiting(2);
        System.out.println("隐试等待2s");

        driver.manage().timeouts().setScriptTimeout(10, TimeUnit.SECONDS);

        // 关闭浏览器
        driver.quit();
    }
}
